package com.jyw.router.hospital.domain.vo;

import cn.hutool.core.util.RandomUtil;
import com.jyw.router.hospital.domain.HospitalInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.Date;

/**
 * @author 沈峻
 * @ClassName RegisterHospitalVo
 * @Description TODO
 * @Date 2023/4/10 16:29
 **/
@ApiModel("医院注册请求实体")
@Data
public class RegisterHospitalVo {

    @ApiModelProperty("服务名称")
    private String serverName;

    @ApiModelProperty("服务地址")
    private String serverUrl;

    public HospitalInfo buildHospitalInfo(){
        HospitalInfo info = new HospitalInfo();
        info.setServerName(getServerName());
        info.setServerUrl(getServerUrl());
        info.setServerKey(RandomUtil.randomString(16));
        info.setServerSecret(RandomUtil.randomString(32));
        info.setCreateTime(LocalDateTime.now());
        info.setRecordState(0);
        return info;
    }
}
